import java.util.Scanner;
public class question {
    public static void main(String[] args) {
        int k;
        int total,answer=0;
        int answer2;
        int count=0;
        System.out.println("请输入你需要练习的题目数：");
        Scanner input=new Scanner(System.in);
        total=input.nextInt();
        question question=new question();
        for(int n=0;n<total;n++) {
            int i=(int)(Math.random()*100);
            int j=(int)(Math.random()*100);
            switch((int)(Math.random()*4)) {
                case 0:
                    System.out.println(i+"+"+j+"=");
                    answer=i+j;
                    break;
                case 1:
                    if(i<j) {
                        int temp=i;
                        i=j;
                        j=temp;
                    }
                    System.out.println(i+"-"+j+"=");
                    answer=i-j;
                    break;
                case 2:
                    System.out.println(i+"*"+j+"=");
                    answer=i*j;
                    break;
                case 3:
                    while(j==0)
                        j= (int)(Math.random()*100);
                    System.out.println(i+"/"+j+"=");
                    answer=i/j;
                    break;
            }
            Scanner input2=new Scanner(System.in);
            answer2=input2.nextInt();
            if(answer2==answer){
                System.out.println("正确！");
                count++;
            }
            else{
                System.out.println("错误！");
            }
        }
        float cent=(float)count/(float)total;
        System.out.println("正确率为"+cent);
    }
}